<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Expense Sheet</title>
<jsp:include page="/WEB-INF/jspf/header.jsp"></jsp:include>
<script src="${pageContext.request.contextPath}/js/metro-dialog.js"></script>
<script src="${pageContext.request.contextPath}/js/util.js"></script>
</head>
<body class="metro">
	<div class="grid" style="padding-left: 15px;">
		<div class="row">
			<div class="span4">
				Welcome "${sessionScope.rslt.fname}"
				<div class="grid" style="padding-right: 20px;">
					<jsp:include page="/WEB-INF/jspf/leftmenu.jsp"></jsp:include>
				</div>
			</div>
			<div class="span8">
				<div class="div-header">
					<h3 class="head-title">Your account details</h3>
				</div>
				<form method="POST" action="expense">
					<table border="0" class="table hovered">
						<tr>
							<td><font SIZE="2">Date</font></td>
							<td><input type="date" name="dt" id="date"
								required="required" placeholder="Enter date" size="20"></td>
						</tr>
						<tr>
							<td><font SIZE="2">Item</font></td>
							<td><input type="text" name="itm" id="item"
								required="required" placeholder="Enter item details" size="20"></td>
						</tr>
						<tr>
							<td><font SIZE="2">Price</font></td>
							<td><input type="text" name="pric" id="price"
								required="required" placeholder="Enter price" size="20"></td>
						</tr>
						<tr>
							<td><font SIZE="2">Expense</font></td>
							<td><input type="text" name="expns" id="expense"
								required="required" placeholder="Enter total expense" size="20"></td>
						</tr>
						<tr>
							<td>&nbsp;</td>
							<td><input type="submit" class="button small info"
								value="Submit" name="B1"></td>
						</tr>
					</table>
				</form>
				<c:choose>
					<c:when test="${requestScope.etrystatus > 0}">Record Inserted Successfully</c:when>
					<c:otherwise>Invalid Entry</c:otherwise>
				</c:choose>
			</div>
		</div>

		<div class="row">
			<div class="span8 offset4">
				<div class="div-header" style="padding-bottom: 10px;">Expense Sheet</div>
				<c:set var="index" value="6" />
				<table class="table striped3n">
					<thead>
						<tr style="text-align: left;">
							<th>Date</td>
							<th>Item</td>
							<th>Price</td>
						</tr>
					</thead>
					<tbody>
						<c:forEach var="expnsrprt" items="${requestScope.expnslist}">
							<tr>
								<td>${expnsrprt.date}</td>
								<td>${expnsrprt.item}</td>
								<td>${expnsrprt.price}</td>
								<td></td>
							</tr>
						</c:forEach>
						<tr>
							<td colspan="2"><b>Total Expense</b></td>
							<td><b>${requestScope.totalExpense}</b></td>
						</tr>
					</tbody>
				</table>
			</div>
		</div>
</body>
</html>